using System;
using System.Text;

/// The whole class simply doesn't exists if i'm not building the debug version
#if DEBUG		

namespace Handrise.BasicModal.Serialization.Util
{
    internal delegate void Write(String msg);
	internal enum DebugLevel {NONE,ERROR,INFO,VERBOSE};

	/// <summary>
	/// Small class used to track debug messages.
	/// </summary>
	public class Debug
	{
		internal void WriteDebug(DebugLevel requestedLevel,string Message)
		{
			StringBuilder sb = new StringBuilder();
			sb.Append(application);
			sb.Append(":");
			sb.Append(Message);
			sb.Append(NewLine);

			if(level>=requestedLevel)
				write(sb.ToString());
		}

		private DebugLevel level;
		private String application;
		private Write write;

		private const String NewLine = "\r\n";

		internal Debug(DebugLevel level,String application,Write write)
		{
			this.level = level;
			this.application = application;
			this.write = write;
		}

		/* Write Delegates */
		public static void WriteScreen(String msg)
		{Console.Write(msg);}
	}
}
#endif